<?php
namespace app\admin\validate;
use think\Validate;
class Type extends Validate
{
	protected $rule = [
		['name','require|max:10','分类名必须传递|分类名不得超过10'],
		['parent_id','number'],
		['id','number'],
		['listorder','number'],
		['status', 'number|in:-1,0,1','状态必须是数字|状态范围不合法'],
	];

	/**场景设置**/
    protected  $scene = [
        'add' => ['name', 'parent_id', 'id'],// 添加
        'listorder' => ['id', 'listorder'], //排序
        'status' => ['id', 'status'],
    ];
}